export default {
    namespaced: true,
    state: () => ({
		isLogin: uni.getStorageSync('token') != '',
		token: uni.getStorageSync('LOGIN_STATUS') || null,
		userInfo: null,
		uid: uni.getStorageSync('UID') || null,
        systemlang: 'cn',
    }),
    mutations: {
		LOGIN(state, opt) {
			state.token = opt.token;
		},
		SETUID(state,val){
			state.uid = val;
		},
		UPDATE_LOGIN(state, token) {
			state.token = token;
		},
		LOGOUT(state) {
			state.token = undefined;
			state.uid = undefined
			uni.clearStorageSync('LOGIN_STATUS');
			uni.clearStorageSync('UID');
		},
		UPDATE_USERINFO(state, userInfo) {
			state.userInfo = userInfo;
		},
        SETLANG(state, msg) {
            state.systemlang = msg
        },
    },
    actions: {
        // 请求数据函数
    }
}